@extends('layouts.scaffold')

@section('head')
	<script src="//code.jquery.com/jquery-1.10.2.js"></script>
	{{ HTML::style('styles/map.css') }}
	{{ HTML::script('angularjs/drag.js')}}

	<script>
		$(function()
		{
			$('.car').drags();
		});

	</script>

	<script type="text/javascript">
		var mapController = function($scope){
			$scope.teams = {{$teams}};
			$scope.showCars = true;
			if($scope.teams == -1)
			{
				$scope.showCars = false;
			}
		}

	</script>
@endsection

@section('navbar')
	@include('menu.navbar')
@endsection

@section('main')

<div class="main" ng-controller="mapController">
	<div class="col-md-1 cars" ng-if="showCars">
		<table><tr ng-repeat="team in teams">
			<td><img class="car" src="{{URL::asset('img/mapa/[[team.teamid]].png')}}"></td>
		</tr></table>
	</div>
	<div class="col-md-1 bg-danger msgError" ng-if="!showCars">
		<p><strong>Defina um jogo como activo <a href="{{URL::to('jogos')}}">aqui</a>.</strong></p> 
	</div>
	<div class="col-md-10 mapDiv">
		<img class="map" src="{{URL::asset('img/mapa/map.png')}}">
	</div>
	
</div>

@endsection

@section('scripts')
@endsection